
#include "incs.h"

int main() {

    printf_init(9600);
    delay_init();

    flash_init();

    delay_s(10);

    p();
    int address = 4 * 1024 - 3;
    printf("address = %p\r\n", (byte *)address);
    printf("address = %d\r\n", *(byte *)address);
    printf("address = %p\r\n", (byte *)address + 100);
    printf("address = %d\r\n", *((byte *)address + 100));

    // byte data[301] = {0};
    // for (int i = 0; i < 300; i++) {
    //     data[i] = next_rand_char();
    // }
    // p();
    // printf("write data:%s\r\n", data);
    // p();
    // flash_write(address, data, 301);
    // memset(data, 0, 301);
    // p();
    // p_barr(data, 10);
    // p();
    // flash_read(address, data, 301);
    // p();
    // printf("read data:%s\r\n", data);
    // p();
    // p_barr(data, 10);

    // p();
    // int cap = flash_capacity();
    // p_i(cap);
    // p();
    // int address = cap + 10000;
    // p_i(address);
    // p_i(flash_read_byte(address));
    // p();
    // flash_write_byte(address, 99);
    // p();
    // p_i(flash_read_byte(address));
    p();
    while (true) {

        p_str("main running");

        delay_s(10);
    }

    return 0;
}
